﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Kimgwajang.MidnightPeach.Forms
{
    public partial class PackageForm : Form
    {
        public PackageDataSet _packageDataSet;

        public PackageForm()
        {
            InitializeComponent();
        }

        public PackageForm(PackageDataSet packageDataSet) : this()
        {
            _packageDataSet = packageDataSet;
        }

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            bdsVariable.DataSource = _packageDataSet.Variable;
            bdsTemplate.DataSource = _packageDataSet.Template;
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            bdsVariable.EndEdit();
            bdsTemplate.EndEdit();

            base.OnClosing(e);
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        
    }
}